﻿#pragma once

#include "Forms/Client.CMain.h"
#include "Forms/Launcher.AMain.h"
#include <string>
#include <vector>
#include <stdexcept>
#include <any>
#include "exceptionhelper.h"
#include "../tangible_filesystem.h"

using namespace Launcher;

namespace Client
{
    class Program final
    {
    public:
        static CMain *Form;
        static AMain *PForm;

        static bool Restart;

//C# TO C++ CONVERTER NOTE: The following .NET attribute has no direct equivalent in C++:
//ORIGINAL LINE: [STAThread] private static void Main(string[] args)
        static void Main(std::vector<std::string> &args);

    private:
        static bool UpdatePatcher();

    public:
        class RuntimePolicyHelper final
        {
        private:
            static bool LegacyV2RuntimeEnabledSuccessfully;

        public:
            static bool getLegacyV2RuntimeEnabledSuccessfully();
            static void setLegacyV2RuntimeEnabledSuccessfully(bool value);

        private:
            class StaticConstructor
            {
            public:
                StaticConstructor();
            };

        private:
            static RuntimePolicyHelper::StaticConstructor staticConstructor;


        private:
//C# TO C++ CONVERTER NOTE: The following .NET attribute has no direct equivalent in C++:
//ORIGINAL LINE: [ComImport][InterfaceType(ComInterfaceType.InterfaceIsIUnknown)][Guid("BD39D1D2-BA2F-486A-89B0-B4B0CB466891")] private interface ICLRRuntimeInfo
            class ICLRRuntimeInfo
            {
            public:
                virtual void xGetVersionString() = 0;
                virtual void xGetRuntimeDirectory() = 0;
                virtual void xIsLoaded() = 0;
                virtual void xIsLoadable() = 0;
                virtual void xLoadErrorString() = 0;
                virtual void xLoadLibrary() = 0;
                virtual void xGetProcAddress() = 0;
                virtual void xGetInterface() = 0;
                virtual void xSetDefaultStartupFlags() = 0;
                virtual void xGetDefaultStartupFlags() = 0;

//C# TO C++ CONVERTER NOTE: The following .NET attribute has no direct equivalent in C++:
//ORIGINAL LINE: [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] void BindAsLegacyV2Runtime();
                virtual void BindAsLegacyV2Runtime() = 0;
            };
        };

    };
}
